package cn.zw.frr.test.controller;

import cn.zw.frr.core.Pipe;
import cn.zw.frr.factory.DataDTO;
import cn.zw.frr.ringbuffer.BaseCommond;
import cn.zw.frr.ringbuffer.EventCommond;

import cn.zw.frr.test.dto.UserDTO;
import cn.zw.frr.test.service.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.lang.reflect.InvocationTargetException;

@RestController
@RequestMapping
public class UserController extends Pipe<DataDTO> {


    @Autowired
    UserServiceImpl userService;

    @Autowired
    EventCommond eventCommond;


    @Override
    public BaseCommond inFunc(DataDTO arg) {
        return eventCommond.
                setiEventService(1, userService).
                setDTO(arg);
    }

    @PostMapping("/do")
    public void doSomething(@RequestBody UserDTO userDTO)  {
         setIn(1,"doSomething",UserDTO.class,userDTO).exec();
    }


}
